<template>
  <div class="link-layer-content flex">
    <div class="link-layer-left">
      <ul>
        <li v-if="link.activityType == 0" class="active">秒杀活动</li>
        <li v-if="link.activityType == 2" class="active">社区团购</li>
      </ul>
    </div>
    <div class="link-layer-right flex-item">
      <component-seckill-sel :activityType="link.activityType" v-on:selectPromotion="selectPromotion"></component-seckill-sel>
    </div>
  </div>
</template>

<script>
  import ComponentSeckillSel from './../ComponentSeckillSel'

  export default {
    components: {
      ComponentSeckillSel
    },
    props: {
      link: {
        type: Object,
        default: {}
      }
    },
    data() {
      return {
      }
    },
    // 初始化页面
    created() {
    },
    filters: {
      priceFilter(e) {
        return e.toFixed(2)
      }
    },
    mounted() {
    },
    methods: {
      setLinkType(linkType, linkParams) {
        this.link.linkType = linkType
        switch (linkType) {
          default:
          case '1002':
            this.link.linkRemark = '基础链接 - 分类'
            break
          case '1101':
            this.link.linkRemark = '自定义页面'
            break
        }
        if (linkParams) {
          this.link.linkParams = '?pageId=' + linkParams.pageId
        }
        this.$emit('selectLink', this.link)
      },
      selectPromotion(item) {
        this.link.promotionId = item.promotionId
        this.link.title = item.title
        this.link.promotionStatus = item.promotionStatus
        this.link.goodsCount = item.goodsCount
        this.link.startTime = item.startTime
        this.link.endTime = item.endTime
        this.$emit('selectLink', this.link)
      }
    }
  }

</script>
